# 不定长参数 参数单星
def add(*a, sum1=1):
    sum = 0
    for i in a:
        sum = sum + i
    return sum + sum1

print(add(1,2,3,4,5,6,7,8,9,10, sum1=10))
print(add(*[1,2,3,4,5,6,7,8,9,10], sum1=10))

# 函数双星
# 加了星号（*）的变量名会存放所有未命名的变量参数。而加(**)的变量名会存放命名的变量参数
def print_info(**kwargs):
    print(kwargs)
    for i in kwargs:
        print(i, kwargs[i])

print(print_info(name='张三', age=18))

print(print_info(**{'name':'张三', 'age':18}))